import http from './http'
import qs from 'qs'

const userConfig = {
    transformRequest: [
        function (data) {
            return qs.stringify(data,{indices: false});
        }
    ],
    headers: {
        'Content-Type': 'application/x-www-form-urlencoded',
    }
};

const selectList = params => http('post', '/api/v1/user/list', params, userConfig)
const deleteUser = params => http('post', '/api/v1/user/delete', params, userConfig)
const addUser = params => http('post', '/api/v1/user/add', params, userConfig)
const editUser = params => http('post', '/api/v1/user/edit', params, userConfig)

export { selectList, deleteUser, addUser, editUser }

/*
不会写es6，看传统es5写法
export const login = function(req) {
    return http('post','/GetTreeListForSoilByRegion',params)
}
*/